﻿<%@ Page Title="" Language="C#" MasterPageFile="~/rightContent.Master" AutoEventWireup="true"
  EnableEventValidation="false"    CodeBehind="customerView.aspx.cs" Inherits="WEB.customer.customerView" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="title" runat="server">
    客户信息
</asp:Content>


<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
   <script type="text/javascript">
       var prevselitem = null;
       function selectx(row) {
           if (prevselitem != null) {
               prevselitem.style.backgroundColor = '#ffffff';
           }
           row.style.backgroundColor = '#99FF66';
           prevselitem = row;

       }
 </script>

    <table width="100%">
        <tr>
            <td>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td>
                <div style="margin-left: '100px';">
                    <table>
                        <tr>
                            <td width="300px">
                                &nbsp;
                            </td>
                            <td align="center" valign="middle">
                                请选择搜索条件:<asp:DropDownList ID="ddlQuery1" runat="server" Style="text-align: right"
                                    Width="101px">
                                    <asp:ListItem Value="CustomerName">客户名</asp:ListItem>
                                    <asp:ListItem Value="CPName">联系人姓名</asp:ListItem>
                                    <asp:ListItem Value="MobilePhone">手机</asp:ListItem>
                                    <asp:ListItem Value="CPPhone">固定电话</asp:ListItem>
                                    <asp:ListItem Value="customerNO">报检代码</asp:ListItem>
                                    <asp:ListItem Value="Invoice">发票抬头</asp:ListItem>
                                    <asp:ListItem Value="PostCode">邮编</asp:ListItem>
                                    <asp:ListItem Value="codeName">客户类别</asp:ListItem>
                                </asp:DropDownList>
                                <asp:TextBox ID="tbQuery1" runat="server" Width="233px"></asp:TextBox>
                                <asp:Button ID="btnQuery1" runat="server" Text="   查  询" OnClick="btnQuery1_Click"
                                    CssClass="Submit_Query" />
                            </td>
                        </tr>
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td align="center">
                <asp:GridView ID="gvCustomerManage" runat="server" AutoGenerateColumns="False" OnRowCommand="gvCustomerManage_RowCommand"
                    AllowPaging="True" OnPageIndexChanging="gvCustomerManage_PageIndexChanging" CssClass="distance"
                    DataKeyNames="cID" BorderStyle="Double" Width="2500px" PageSize="20" OnRowCreated="gvCustomerManage_RowCreated"
                    OnRowDataBound="gvCustomerManage_RowDataBound" BorderColor="#333300" BorderWidth="1px">
                    <Columns>
                        <asp:BoundField DataField="codeName" HeaderText="客户类型">
                            <HeaderStyle Width="70px" />
                            <ItemStyle Width="70px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CustomerName" HeaderText="客户公司名">
                            <HeaderStyle Width="250px" />
                            <ItemStyle Width="250px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="TaxNO" HeaderText="税务识别号">
                            <HeaderStyle Width="80px" />
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="CustomerNO" HeaderText="报检代码">
                            <HeaderStyle Width="80px" />
                            <ItemStyle Width="80px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="InvType" HeaderText="发票类型">
                            <HeaderStyle Width="70px" />
                            <ItemStyle Width="70px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Invoice" HeaderText="发票抬头">
                            <HeaderStyle Width="60px" />
                            <ItemStyle Width="60px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="PostCode" HeaderText="邮编">
                            <HeaderStyle Width="70px" />
                            <ItemStyle Width="70px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Address" HeaderText="地址">
                            <HeaderStyle Width="180px" />
                            <ItemStyle Width="180px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Remarks" HeaderText="工作要求">
                            <HeaderStyle Width="200px" />
                            <ItemStyle Width="200px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="姓名" DataField="CPName">
                            <HeaderStyle Width="60px" />
                            <ItemStyle Width="60px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="性别" DataField="CPSex">
                            <HeaderStyle Width="50px" />
                            <ItemStyle Width="30px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="职务" DataField="CPPost">
                            <HeaderStyle Width="70px" />
                            <ItemStyle Width="70px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="手机" DataField="MobilePhone">
                            <HeaderStyle Width="100px" />
                            <ItemStyle Width="100px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="固定电话" DataField="CPPhone">
                            <HeaderStyle Width="100px" />
                            <ItemStyle Width="100px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Fax" HeaderText="传真">
                            <ItemStyle Width="100px" />
                        </asp:BoundField>
                        <asp:BoundField HeaderText="Email" DataField="Email">
                            <HeaderStyle Width="150px" />
                        </asp:BoundField>
                        <asp:BoundField DataField="Rem" HeaderText="备注"></asp:BoundField>
                        <asp:TemplateField HeaderText="编辑" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="Button1" runat="server" CausesValidation="false" OnClick="Button1_Click"
                                    CommandArgument='<%# Eval("ID") %>' Text="编辑" />
                            </ItemTemplate>
                            <ControlStyle CssClass="Submit_gv" />
                            <ItemStyle Width="50px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="删除" ShowHeader="False">
                            <ItemTemplate>
                                <asp:Button ID="Button2" runat="server" CausesValidation="false" OnClientClick="return confirm('确认删除?')"
                                    OnClick="Button2_Click" CommandArgument='<%# Eval("ID") %>' Text="删除" />
                            </ItemTemplate>
                            <ControlStyle CssClass="Submit_gv" />
                            <HeaderStyle Width="50px" />
                            <ItemStyle Width="50px" />
                        </asp:TemplateField>
                        <asp:ButtonField ButtonType="Button" CommandName="Add" Text="增加联系人">
                            <ControlStyle CssClass="Submit_gvbig" />
                            <HeaderStyle Width="80px" />
                            <ItemStyle Width="80px" />
                        </asp:ButtonField>
                        <asp:ButtonField ButtonType="Button" CommandName="Edit" Text="修改公司信息">
                            <ControlStyle CssClass="Submit_gvbig" />
                            <HeaderStyle Width="80px" />
                            <ItemStyle Width="80px" />
                        </asp:ButtonField>
                        <asp:ButtonField ButtonType="Button" CommandName="addCon" Text="增加合同">
                            <ControlStyle CssClass="Submit_gvbig" />
                            <ItemStyle Width="80px" />
                        </asp:ButtonField>
                    </Columns>
                    <EmptyDataRowStyle BackColor="Red" />
                    <FooterStyle Wrap="True" />
                    <PagerStyle Wrap="True" />
                    <HeaderStyle Font-Size="Small" Wrap="True" />
                       <PagerTemplate>
     <br />
     <asp:Label ID="lblPage" runat="Server" Text='<%# "第" +( ((GridView)Container.NamingContainer).PageIndex +1 ) +"页/共"+ (((GridView)Container.NamingContainer).PageCount) +"页" %>'></asp:Label>
     <asp:LinkButton ID="lbnFirst" runat="Server" Text="首页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="First" ></asp:LinkButton>
     <asp:LinkButton ID="lbnPrev" runat="server" Text="上一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != 0 %>' CommandName="Page" CommandArgument="Prev" ></asp:LinkButton>
     <asp:LinkButton ID="lbnNext" runat="Server" Text="下一页" Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Next" ></asp:LinkButton> 
     <asp:LinkButton ID="lbnLast" runat="Server" Text="尾页"   Enabled='<%# ((GridView)Container.NamingContainer).PageIndex != (((GridView)Container.NamingContainer).PageCount - 1) %>' CommandName="Page" CommandArgument="Last" ></asp:LinkButton> 
      到第
       <asp:TextBox ID="tbinPageNum" runat="server"></asp:TextBox>
      页 
      <asp:Button ID="Button" CommandName="go" runat="server" Text ="go"  OnClick="Button_Click" 
     
     />
      
       <br />
</PagerTemplate>
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Content>
